--[[
dispatch all request
--]]

-- ngx.say("dispater.lua")



-- local mp = require ('MessagePack')
local cjson = require("cjson")
local function _log(str)
  ngx.log(ngx.ERR, str)
end

local upserver = ngx.shared.upserver
-- local i = upserver:get('i')
-- if not i then
--   ngx.say("not ready")
-- else
--   ngx.say("i=" .. i)
-- end

local tmp1 = upserver:get('server')
if not tmp1 then return ngx.say("server not ready") end
ngx.say(tmp1)


-- local servers = mp.unpack(tmp1)
local servers = cjson.decode(tmp1)
-- servers { type1 = {ip1, ip2}, type2 = {ip1, ip2} }